﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Test.UI
{
    public partial class AddInfo : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            var name = TextBox1.Value;
            var comment = TextBox2.Text;

            Model.ClassInfo info = new Model.ClassInfo()
            {
                Comment = comment,
                Name = name
            };

            if (BLL.ClassInfoBLL.Insert(info) > 0)
            {
                Response.Write("<script>alert('添加成功！');location='ClassInfo.aspx';</script>");
            }
        }
    }
}